package com.igeek.javase.relation.shopping;

/**
 * @author chenmin
 * 2023/7/13 20:10
 * @description TODO
 */
public class Order {

    private String orderNumber;

    private User user;

    private  Goods[] goods;

    public void showOrderDetail(){
        System.out.println("订单号："+orderNumber);
        System.out.println("下单者："+user.getName());
        System.out.println("=====商品信息=====");
        if(goods!=null){
            for (Goods good : goods) {
                if(good!=null){
                    good.showGoods();
                }
            }
        }
    }

    
    public Order(){

    }
    //public Order(String orderNumber, String user, String goods) {}


    public Order(String orderNumber, User user, Goods[] goods) {
        this.orderNumber = orderNumber;
        this.user = user;
        this.goods = goods;
    }

    public String getOrderNumber() {
        return orderNumber;
    }

    public void setOrderNumber(String orderNumber) {
        this.orderNumber = orderNumber;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public Goods[] getGoods() {
        return goods;
    }

    public void setGoods(Goods[] goods) {
        this.goods = goods;
    }

    public void showGoods() {
    }
}
